<?php
echo $javascript->codeBlock("
	$(document).ready(function(){
							   
		// This initialises carousels on the container elements specified, in this case, carousel1.
		$('#carousel1').CloudCarousel(		
			{			
//				reflHeight: 58,
				reflGap:2,
//				titleBox: $('#title-text'),
				altBox: null,
				buttonLeft: $('#left-but'),
				buttonRight: $('#right-but'),
				yRadius:1,
				xRadius:516,
				xPos: 480,
				yPos: 1,
				speed:0.15,
				mouseWheel:true,
				autoRotate: 'right'
			}
		);
	});	
",$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));
?>

<?php if(is_array($items) && !empty($items)){?>
<div id = "carousel1" style="height:195px; width: 960px; "> 
<?php foreach ($items as $key => $photo) {?>
<?php $thumb = $fileUpload->image($photo['StoreUpload']['name'],array('autoResize'=>true,'width'=>$params['width'],'alt'=>$photo['StoreProduct']['name'],'title'=>$photo['StoreProduct']['name'],'class'=>'cloudcarousel','imagePathOnly'=>false)); ?>
<?php echo $this->Html->link($thumb, array('plugin'=>'store','controller'=>'products','action' => 'view', $photo['StoreProduct']['id'],Inflector::slug($photo['StoreProduct']['name'],'-')),array('escape'=>false,'class'=>"highslide", 'title'=>$photo['StoreProduct']['name'])); ?>

<?php }?>
</div>

<!--<input id="left-but"  type="image" value="Left" src="<?php echo '/img/'.HOST.'/carousel.left.png'?>" />-->
<!--<input id="right-but" type="image" value="Right" src="<?php echo '/img/'.HOST.'/carousel.right.png'?>" />-->
<?php }?>